package com.xtc.springboot.dubbo;

import com.xtc.springboot.dubbo.service.ISayHelloService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Hello world!
 *
 * @author Administrator
 */
@RestController
@SpringBootApplication
public class SpringbootDubboConsumerApp {
    public static void main(String[] args) {
        SpringApplication.run(SpringbootDubboConsumerApp.class, args);
    }

    @DubboReference(registry = {"shanghai","shenzhen"}, version = "2.0")
    private ISayHelloService sayHelloService;

    @RequestMapping("/say")
    public String say() {
        return sayHelloService.sayHello("liming");
    }
}
